Image composition for extended reality systems

ABSTRACT

Implementations of the subject technology provide for image composition for extended reality systems. Image composition may include combining virtual content from virtual images with physical content from images captured by one or more cameras. The virtual content and the physical content can be combined to form a composite image using depth information for the virtual content and the physical content. An adjustment mask may be generated to indicate edges or boundaries between virtual and physical content at which artifact correction for the composite image can be performed.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims the benefit of priority to U.S. ProvisionalPatent Application No. 63/079,977, entitled “Image Composition ForComputer-Generated Reality Systems,” filed on Sep. 17, 2020, thedisclosure of which is hereby incorporated herein in its entirety.

TECHNICAL FIELD

The present description relates generally to extended realityenvironments.

BACKGROUND

Augmented reality technology aims to bridge a gap between virtualenvironments and a physical environment by providing an enhancedphysical environment that is augmented with electronic information. As aresult, the electronic information appears to be part of the physicalenvironment as perceived by a user while the user views the physicalenvironment via the augmented reality technology. However, it can bechallenging to generate composite images that include physical objectsand virtual objects.

BRIEF DESCRIPTION OF THE DRAWINGS

Certain features of the subject technology are set forth in the appendedclaims. However, for purpose of explanation, several embodiments of thesubject technology are set forth in the following figures.

FIG. 1 illustrates an example system architecture including variouselectronic devices that may implement the subject system in accordancewith one or more implementations.

FIG. 2 illustrates a block diagram of example features of an electronicdevice, in accordance with one or more implementations.

FIG. 3 illustrates examples of a virtual image, a virtual depth image,an image of a physical environment, and a physical depth image, inaccordance with one or more implementations.

FIG. 4 illustrates examples of an occlusion mask and an alpha mask, inaccordance with one or more implementations.

FIG. 5 illustrates an example of a composite image having artifacts, inaccordance with one or more implementations.

FIG. 6 illustrates a schematic flow diagram for generation of anadjustment mask, in accordance with one or more implementations.

FIG. 7 illustrates a schematic flow diagram for splitting an adjustmentmask to form an interior adjustment mask and an exterior adjustmentmask, in accordance with one or more implementations.

FIG. 8 illustrates a flow chart of an example process for imagecomposition for extended reality systems in accordance withimplementations of the subject technology.

FIG. 9 illustrates a flow chart of another example process for imagecomposition for extended reality systems in accordance withimplementations of the subject technology.

FIG. 10 illustrates an electronic system with which one or moreimplementations of the subject technology may be implemented.

DETAILED DESCRIPTION

The detailed description set forth below is intended as a description ofvarious configurations of the subject technology and is not intended torepresent the only configurations in which the subject technology can bepracticed. The appended drawings are incorporated herein and constitutea part of the detailed description. The detailed description includesspecific details for the purpose of providing a thorough understandingof the subject technology. However, the subject technology is notlimited to the specific details set forth herein and can be practicedusing one or more other implementations. In one or more implementations,structures and components are shown in block diagram form in order toavoid obscuring the concepts of the subject technology.

A physical environment refers to a physical world that people can senseand/or interact with without aid of electronic devices. The physicalenvironment may include physical features such as a physical surface ora physical object. For example, the physical environment corresponds toa physical park that includes physical trees, physical buildings, andphysical people. People can directly sense and/or interact with thephysical environment such as through sight, touch, hearing, taste, andsmell. In contrast, an extended reality (XR) environment refers to awholly or partially simulated environment that people sense and/orinteract with via an electronic device. For example, the XR environmentmay include augmented reality (AR) content, mixed reality (MR) content,virtual reality (VR) content, and/or the like. With an XR system, asubset of a person's physical motions, or representations thereof, aretracked, and, in response, one or more characteristics of one or morevirtual objects simulated in the XR environment are adjusted in a mannerthat comports with at least one law of physics. As one example, the XRsystem may detect head movement and, in response, adjust graphicalcontent and an acoustic field presented to the person in a mannersimilar to how such views and sounds would change in a physicalenvironment. As another example, the XR system may detect movement ofthe electronic device presenting the XR environment (e.g., a mobilephone, a tablet, a laptop, or the like) and, in response, adjustgraphical content and an acoustic field presented to the person in amanner similar to how such views and sounds would change in a physicalenvironment. In some situations (e.g., for accessibility reasons), theXR system may adjust characteristic(s) of graphical content in the XRenvironment in response to representations of physical motions (e.g.,vocal commands).

There are many different types of electronic systems that enable aperson to sense and/or interact with various XR environments. Examplesinclude head mountable systems, projection-based systems, heads-updisplays (HUDs), vehicle windshields having integrated displaycapability, windows having integrated display capability, displaysformed as lenses designed to be placed on a person's eyes (e.g., similarto contact lenses), headphones/earphones, speaker arrays, input systems(e.g., wearable or handheld controllers with or without hapticfeedback), smartphones, tablets, and desktop/laptop computers. A headmountable system may have one or more speaker(s) and an integratedopaque display. Alternatively, a head mountable system may be configuredto accept an external opaque display (e.g., a smartphone). The headmountable system may incorporate one or more imaging sensors to captureimages or video of the physical environment, and/or one or moremicrophones to capture audio of the physical environment. Rather than anopaque display, a head mountable system may have a transparent ortranslucent display. The transparent or translucent display may have amedium through which light representative of images is directed to aperson's eyes. The display may utilize digital light projection, OLEDs,LEDs, uLEDs, liquid crystal on silicon, laser scanning light source, orany combination of these technologies. The medium may be an opticalwaveguide, a hologram medium, an optical combiner, an optical reflector,or any combination thereof. In some implementations, the transparent ortranslucent display may be configured to become opaque selectively.Projection-based systems may employ retinal projection technology thatprojects graphical images onto a person's retina. Projection systemsalso may be configured to project virtual objects into the physicalenvironment, for example, as a hologram or on a physical surface.

Implementations of the subject technology described herein provide forthe generation of composite images that include partially overlappingphysical objects and virtual objects. In order to generate the compositeimages in a way that prevents inclusion of artifacts caused by edges ofthe overlapping objects, an adjustment mask is generated, in addition toan occlusion mask. The occlusion mask indicates where the physical andvirtual object(s) overlap, and which is in the foreground of the other.A composite image can be generated using image information from theimage of the physical object and a virtual image of the virtual object,using the occlusion mask. The adjustment mask indicates regions in whichan additional correction is to be applied to remove and/or correctartifacts generated from the use of the occlusion mask.

FIG. 1 illustrates an example system architecture 100 including variouselectronic devices that may implement the subject system in accordancewith one or more implementations. Not all of the depicted components maybe used in all implementations, however, and one or more implementationsmay include additional or different components than those shown in thefigure. Variations in the arrangement and type of the components may bemade without departing from the spirit or scope of the claims as setforth herein. Additional components, different components, or fewercomponents may be provided.

The system architecture 100 includes an electronic device 105, ahandheld electronic device 104, an electronic device 110, an electronicdevice 115, and a server 120. For explanatory purposes, the systemarchitecture 100 is illustrated in FIG. 1 as including the electronicdevice 105, the handheld electronic device 104, the electronic device110, the electronic device 115, and the server 120; however, the systemarchitecture 100 may include any number of electronic devices, and anynumber of servers or a data center including multiple servers.

The electronic device 105 may be a smartphone, a tablet, or a headmountable portable system (e.g., a head mountable display device thatcan be worn by a user 101), that includes a display system capable ofpresenting a visualization of an extended reality environment to theuser. The electronic device 105 may be powered with a battery and/oranother power supply. In an example, the display system of theelectronic device 105 provides a stereoscopic presentation of theextended reality environment, enabling a three-dimensional visualdisplay of a rendering of a particular scene, to the user. In one ormore implementations, instead of, or in addition to, utilizing theelectronic device 105 to access an extended reality environment, theuser may use a handheld electronic device 104, such as a tablet, watch,mobile device, and the like.

The electronic device 105 may include one or more cameras such ascamera(s) 150 (e.g., visible light cameras, infrared cameras, etc.)Further, the electronic device 105 may include various sensors 152including, but not limited to, cameras, image sensors, touch sensors,microphones, inertial measurement units (IMU), heart rate sensors,temperature sensors, depth sensors (e.g., Lidar sensors, radar sensors,sonar sensors, time-of-flight sensors, etc.), GPS sensors, Wi-Fisensors, near-field communications sensors, radio frequency sensors,etc. Moreover, the electronic device 105 may include hardware elementsthat can receive user input such as hardware buttons or switches. Userinput detected by such sensors and/or hardware elements correspond tovarious input modalities for initiating generating supplemental virtualcontent within a given extended reality environment. For example, suchinput modalities may include, but are not limited to, facial tracking,eye tracking (e.g., gaze direction), hand tracking, gesture tracking,biometric readings (e.g., heart rate, pulse, pupil dilation, breath,temperature, electroencephalogram, olfactory), recognizing speech oraudio (e.g., particular hotwords), and activating buttons or switches,etc. The electronic device 105 may also detect a presence of a person orobject and/or an occurrence of an event in a scene to initiate providingsupplemental virtual content within the extended reality environment.

The electronic device 105 may be communicatively coupled to a basedevice such as the electronic device 110 and/or the electronic device115. Such a base device may, in general, include more computingresources and/or available power in comparison with the electronicdevice 105. In an example, the electronic device 105 may operate invarious modes. For instance, the electronic device 105 can operate in astandalone mode independent of any base device. When the electronicdevice 105 operates in the standalone mode, the number of inputmodalities may be constrained by power and/or processing limitations ofthe electronic device 105 such as available battery power of the device.In response to power limitations, the electronic device 105 maydeactivate certain sensors within the device itself to preserve batterypower and/or to free processing resources.

The electronic device 105 may also operate in a wireless tethered mode(e.g., connected via a wireless connection with a base device), workingin conjunction with a given base device. The electronic device 105 mayalso work in a connected mode where the electronic device 105 isphysically connected to a base device (e.g., via a cable or some otherphysical connector) and may utilize power resources provided by the basedevice (e.g., where the base device is charging the electronic device105 while physically connected).

When the electronic device 105 operates in the wireless tethered mode orthe connected mode, a least a portion of processing user inputs and/orrendering the extended reality environment may be offloaded to the basedevice thereby reducing processing burdens on the electronic device 105.For instance, in an implementation, the electronic device 105 works inconjunction with the electronic device 110 or the electronic device 115to generate an extended reality environment including physical and/orvirtual objects that enables different forms of interaction (e.g.,visual, auditory, and/or physical or tactile interaction) between theuser and the generated extended reality environment in a real-timemanner. In an example, the electronic device 105 provides a rendering ofa scene corresponding to the extended reality environment that can beperceived by the user and interacted with in a real-time manner.Additionally, as part of presenting the rendered scene, the electronicdevice 105 may provide sound, and/or haptic or tactile feedback to theuser. The content of a given rendered scene may be dependent onavailable processing capability, network availability and capacity,available battery power, and current system workload.

The network 106 may communicatively (directly or indirectly) couple, forexample, the electronic device 105, the electronic device 110, and/orthe electronic device 115 with each other device and/or the server 120.In one or more implementations, the network 106 may be an interconnectednetwork of devices that may include, or may be communicatively coupledto, the

Internet.

The electronic device 110 may include a touchscreen and may be, forexample, a smartphone that includes a touchscreen, a portable computingdevice such as a laptop computer that includes a touchscreen, acompanion device that includes a touchscreen (e.g., a digital camera,headphones), a tablet device that includes a touchscreen, a wearabledevice that includes a touchscreen such as a watch, a band, and thelike, any other appropriate device that includes, for example, atouchscreen, or any electronic device with a touchpad. In one or moreimplementations, the electronic device 110 may not include a touchscreenbut may support touchscreen-like gestures, such as in an extendedreality environment. In one or more implementations, the electronicdevice 110 may include a touchpad. In FIG. 1, by way of example, theelectronic device 110 is depicted as a mobile smartphone device with atouchscreen. In one or more implementations, the electronic device 110,the handheld electronic device 104, and/or the electronic device 105 maybe, and/or may include all or part of, the electronic device discussedbelow with respect to the electronic system discussed below with respectto FIG. 10. In one or more implementations, the electronic device 110may be another device such as an Internet Protocol (IP) camera, atablet, or a companion device such as an electronic stylus, etc.

The electronic device 115 may be, for example, desktop computer, aportable computing device such as a laptop computer, a smartphone, acompanion device (e.g., a digital camera, headphones), a tablet device,a wearable device such as a watch, a band, and the like. In FIG. 1, byway of example, the electronic device 115 is depicted as a desktopcomputer. The electronic device 115 may be, and/or may include all orpart of, the electronic system discussed below with respect to FIG. 10.

The server 120 may form all or part of a network of computers or a groupof servers 130, such as in a cloud computing or data centerimplementation. For example, the server 120 stores data and software,and includes specific hardware (e.g., processors, graphics processorsand other specialized or custom processors) for rendering and generatingcontent such as graphics, images, video, audio and multi-media files forextended reality environments. In an implementation, the server 120 mayfunction as a cloud storage server that stores any of the aforementionedextended reality content generated by the above-discussed devices and/orthe server 120.

FIG. 2 illustrates a block diagram of various components that may beincluded in electronic device 105, in accordance with aspects of thedisclosure. As shown in FIG. 2, electronic device 105 may include one ormore cameras such as camera(s) 150 that capture images of the physicalenvironment (also referred to herein as physical environment images)around the electronic device, one or more sensors 152 that obtainenvironment information (e.g., physical depth information such as inphysical depth images) associated with the physical environment aroundthe electronic device 105. Sensors 152 may include depth sensors (e.g.,time-of-flight sensors, infrared sensors, radar, sonar, lidar, etc.),one or more microphones, and/or other types of sensors for sensing thephysical environment. Electronic device 105 also includes communicationscircuitry 208 for communication with electronic device 110, electronicdevice 115, servers 120, and/or other devices and/or systems in someimplementations. Communications circuitry 208 may include radiofrequency (RF) communications circuitry for detecting radio frequencyidentification (RFID) tags, Bluetooth Low Energy (BLE) communicationscircuitry, other near-field communications (NFC) circuitry, WiFicommunications circuitry, cellular communications circuitry, and/orother wired and/or wireless communications circuitry.

As shown, electronic device 105 includes processing circuitry 204 (e.g.,one or more processors and/or integrated circuits) and memory 206.Memory 206 may store instructions or code for execution by processingcircuitry 204. Memory 206 may store (e.g., temporarily or permanently)content generated by and/or otherwise obtained by electronic device 105.In some operational scenarios, memory 206 may temporarily store images(e.g., physical environment images and/or physical environment imageframes) of a physical environment captured by camera(s) 150, physicaldepth information corresponding to the images such as in physical depthimages (e.g., physical depth image frames) generated, for example, usinga depth sensor of sensors 152 and/or using multiple cameras or usingcamera images combined with motion or IMU information, virtual objectssuch as virtual objects in virtual images (e.g., virtual image frames)generated by processing circuitry 204 to include virtual content, and/orvirtual depth information for the virtual objects such as virtual depthinformation in virtual depth images (e.g., virtual depth image frames)generated by processing circuitry 204 that indicate the depth of eachpixel in the virtual images and/or each of various portions of a virtualobject. Memory 206 may store (e.g., temporarily or permanently)intermediate images, information, and/or masks (e.g., occlusion masks,edge masks, and/or adjustment masks as described herein) generated byprocessing circuitry 204 for combining the image(s) of the physicalenvironment and the virtual objects and/or virtual image(s) to formcomposite images for display by display 200.

FIG. 3 illustrates examples of a virtual image 300, a virtual depthimage 302, an image 304 of a physical environment, and a physical depthimage 306. As illustrated by FIG. 3, a virtual image 300, which may begenerated by an XR application using processing circuitry 204, mayinclude on or more virtual objects such as virtual object 308 andvirtual object 310. Virtual objects 308 and 310 may be stored in avirtual image as in the example of FIG. 3 or can be stored in otherforms (e.g., without generating a virtual image of the virtual objects).Virtual depth image 302 may also be generated by processing circuitry204 (e.g., by the XR application) with depth pixels each indicating thedepth of a corresponding pixel in the virtual image 300. For example,virtual object 308 may have a corresponding depth indicated by thevalues of depth pixels 312 to be less than a corresponding depth ofvirtual object 314 as indicated by the values of depth pixels 314. Thevirtual depth information for virtual objects 308 and 310 can be storedin a virtual depth image as in the example of FIG. 3, or can be storedin other forms (e.g., without generating a virtual depth image). Thevirtual depth image 302 and/or the virtual depth information therein mayalso indicate the varying depths of different portions of athree-dimensional (3D) virtual object. In the example of FIG. 3, virtualobject 308 appears closer to the viewer than virtual object 310, andpartially overlaps virtual object 310. Virtual objects 308 and 310 maybe generated for display within a physical environment scene including aportion of a physical environment of an electronic device such aselectronic device 105.

Image 304 may be captured by one or more cameras such as camera(s) 150of an electronic device such as electronic device 105, and may includeimages of one or more physical objects such as physical object 316 andphysical object 318 in the physical environment of the electronicdevice. In the example of FIG. 3, physical object 316 is a leg and footof a user of the electronic device 105, and the physical object 318 is aportion of the back of another person in the physical environment. Thephysical depth image 306 includes depth pixels that each indicates thedepth of a corresponding pixel in the image 304. The values of the depthpixels in physical depth image 306 may include depth pixels 320indicating the depth of various portions of physical object 316 anddepth pixels 322 indicating the depth of various portions of physicalobject 318. Although the depth information corresponding to the portionof the physical environment captured in image 304 is stored in the formof a physical depth image 306 in the example of FIG. 3, the depthinformation (e.g., depth information corresponding to physical object316 and/or physical object 318) may be stored in other forms (e.g.,without generating a physical depth image).

An electronic device such as electronic device 105 may combine the image304 and the virtual object(s) (e.g., using the virtual image 300), usingthe physical depth information (e.g., in the physical depth image 306)and the virtual depth information (e.g., in the virtual depth image 302,to generate a composite image in which the virtual objects 308 and 310appear in the physical environment with the physical objects 316 and318, at the desired location and depth relative to the physical objects316 and 318.

In various operational scenarios, one or more portions of one or more ofthe virtual objects 308 and 310 may overlap one or more portions of oneor more of the physical objects 316 and 318, and/or one or more portionsof one or more of the physical objects 316 and 318 may overlap one ormore portions of one or more of the virtual objects 308 and 310.

As a part of the process of combining the image 304 and the virtualcontent of virtual image 300, an occlusion mask may be generated thatindicates pixels in the image 304 and pixels in the virtual image 300(e.g., and/or other indications of virtual content at various locations)at which the physical or virtual objects are occluded by others of thevirtual or physical objects. FIG. 4 illustrates an example of anocclusion mask 400 that may be generated for the image 304 and thevirtual image 300, using the corresponding physical depth information inthe physical depth image 306 and the corresponding virtual depthinformation in the virtual depth image 302.

In the example of FIG. 4, the occlusion mask 400 includes occlusion maskpixel values 404 that indicate pixel locations in the image 304 and thevirtual image 300 at which physical objects 316 and 318 are foreground(e.g., closer to the viewer) to the virtual objects 308 and 310. Forexample, the occlusion mask pixel values of the occlusion mask 400 maybe binary pixel values (e.g., having a first value such as one toindicate that a physical object is foreground to a virtual object or asecond value such as zero to indicate that no physical object isforeground to a virtual object).

In one or more implementations, the occlusion mask 400 can be used togenerate a composite image. For example, where the occlusion mask pixelvalues of the occlusion mask 400 are one and/or where there is nocorresponding virtual content at that pixel (e.g., in the virtual image300), the corresponding pixels of the image 304 can be used as thecomposite image pixel values, and where the occlusion mask pixel valuesof the occlusion mask 400 are zero and virtual content such as a virtualobject exists (e.g., is rendered) at that pixel, the correspondingpixels of the virtual image 300 can be used as the composite imagepixels. However, applying the occlusion mask 400 in this way cangenerate visible transitions at the boundaries of the occluded regions(e.g., due in part to a resolution mismatch between the virtual orphysical environment information and/or images and/or virtual orphysical depth information and/or images) that appear unnatural and/ordistracting to a user.

In order to more smoothly combine the image 304 and the virtual image300, an electronic device such as electronic device 105 may generate analpha mask 402 based on the occlusion mask 400. In contrast with thebinary values of the occlusion mask pixels of the occlusion mask 400,the alpha mask 402 may have alpha mask pixel values 406 in a range suchas the range [0, . . , 1], or a representation thereof (e.g. [0, . . . ,255]). The alpha mask 402 may be generated, for example, by applying aguided filter having the occlusion mask 400 and the image 304 as inputin order to generate alpha mask pixel values 406. In this example, thealpha mask pixel values 406 may be computed from the dot product betweenmultiple coefficients (e.g., a coefficient for each color of thephysical environment image and/or the virtual image, and a biascoefficient) and the color pixel values of the image 304. The colorpixel values of the virtual image 300 and the image 304 can be combinedusing the values of alpha mask pixels to provide a blend of the color ofthe virtual information and the color of the physical information forpixels at or near the interface between overlapping virtual and physicalobjects in the composite image.

FIG. 5 illustrates a composite image 500 generated by combining image304 and the virtual content of the virtual image 300 of FIG. 3 using thealpha mask pixel values 406 of the alpha mask 402 of FIG. 4. As shown inFIG. 5, the virtual object 308 partially occludes the physical object316 (e.g., the user's foot), which itself partially occludes the virtualobject 310. The physical object 318 can also be seen partially occludingthe virtual object 310.

In the example of FIG. 5, the composite image 500 includes (i)boundaries 506 at locations at which a physical object (e.g., physicalobject 318 corresponding to the back of a person in a chair) is in frontof a background virtual object (e.g., virtual object 310) and ends(e.g., at the edge of the person's back) and thus no longer occludes thebackground virtual object, (ii) boundaries 508 at locations at which abackground virtual object (e.g., virtual object 310) is still beingoccluded by a physical object (e.g., physical object 318) and endsbehind the physical object (e.g., at the edge of the virtual object 310that is located behind the person's back and thus not visible in thecomposite image), and (iii) boundaries 504 at locations at which avirtual object (e.g., virtual object 308) is located in front of aphysical object (e.g., physical object 316 corresponding to the user'sfoot) that occludes another virtual object (e.g., virtual object 310)and occludes the real object that is occluding the other virtual object.

Turning back to FIG. 4, it can be seen that each of the boundaries 504,506, and 508 correspond to an edge in the occlusion mask 400 (e.g., anedge at boundary between an occluded pixel value, such as one, and anunoccluded pixel value, such as zero). Composite images generated usingan alpha mask such as alpha mask 402 to combine a virtual image and aphysical environment image may generate artifacts in a composite image.Artifacts in a composite image generated using an alpha mask asdescribed may occur particularly at locations where an edge in theocclusion mask 400 corresponds to an edge of a virtual object. In theexample of FIG. 5, examples of such artifacts can be seen at theboundaries 504 and 508.

Implementations of the subject technology provide for the identificationand correction and/or adjustment of artifacts in composite images, suchas the artifacts shown in the example of FIG. 5.

For example, as illustrated in FIG. 6, an edge mask 600 may be generatedbased on the virtual content, such as virtual depth image 302 (or thevirtual image 300) and/or the virtual object(s) 308 and/or 310. Forexample, the edge mask 600 may be generated by running an edge filter onthe virtual depth image 302, such as by setting edge pixels in the edgemask 600 to a first value (e.g., one) when the edge filter response ofthe virtual depth image 302 is greater than a threshold and to a secondvalue (e.g., zero) when the edge filter response of the virtual depthimage 302 is less than a threshold. In this way, the edges of thevirtual objects in the virtual image 300 can be identified. Thethreshold can be adjusted to keep only the strongest edges of thevirtual objects and avoid identifying noise in the virtual depth imageas edges.

In one or more implementations, a dilated edge mask 602 may also begenerated (e.g., by increasing the width of the detected edges, such asby setting the edge values of a predetermined number of edge pixels thatare adjacent to an edge pixel have the first value, to the first value).In one or more implementations, a dilated occlusion mask 604 may also begenerated based on the occlusion mask 400 (e.g., by dilating theocclusion mask 400). Dilating the occlusion mask may include expandingthe edges in the occlusion mask 400 (e.g., by setting the occlusion maskpixel values of a predetermined number of occlusion mask pixels that areadjacent to an occlusion mask pixel having a first value, to the firstvalue).

As shown in FIG. 6, an adjustment mask 606 can be generated based on theedge mask 600 and the occlusion mask 400 (e.g., based on the dilatededge mask 602 and the dilated occlusion mask 604). For example, theadjustment mask 606 may be a logical AND of the dilated edge mask 602and the dilated occlusion mask 604.

For example, the adjustment mask 606 may include adjustment pixel values608 (e.g., having a first value such as one) that indicate a correctionand/or adjustment is to be applied to the corresponding composite imagepixels in the composite image 500. The adjustment mask 606 may includeadjustment pixel values having a second value, such as zero, where nocorrection/adjustment is to be applied. Looking back to FIGS. 4 and 5,the pixels identified for adjustment in the adjustment mask 606correspond to the boundaries 504 and 508 in composite image 500, whichcorrespond to edges in the occlusion mask 400 that occur at an edge of avirtual object. Accordingly, the adjustment mask 606 identifies (e.g.,flags) locations (e.g., pixels) in the composite image 500 at which thealpha mask 402 may produce artifacts.

A composite image generated by combining an image 304 of the physicalenvironment with virtual content and/or objects such as in a virtualimage 300 can then be corrected or adjusted to remove artifacts bymodifying the pixels of the composite image that are flagged by theadjustment mask 606 (e.g., the pixels of the composite imagecorresponding to the adjustment pixel values 608).

In one or more implementations, correcting the composite image 500 basedon the adjustment mask may include overriding the alpha mask for thepixels of the composite image/alpha mask that correspond to adjustmentpixel values 608 of the adjustment mask 606. For example, overriding thealpha mask may include ignoring the alpha mask value and selecting apixel value directly from the virtual image 300 or the image 304 (e.g.,based on the occlusion mask 400) for any composite image pixelcorresponding to an adjustment pixel value 608 of the adjustment mask606.

However, because the combination of the image 304 and the virtual image300 using the alpha mask 402 may correct for other combination issuessuch as a differing resolution between the image 304 and the virtualcontent information such as the virtual image 300 (and/or the image(s)and the depth image(s)), correcting the composite image 500 byoverriding the alpha mask may allow other artifacts to appear in thecomposite image. In one or more implementations, applying the correctionto the alpha mask 402 may generate improved artifact reduction. Forexample, in one or more implementations, correcting the pixel values ofthe composite image may include modifying the alpha mask 402 based onthe adjustment mask 606. Modifying the alpha mask 402 may includemodifying the values (e.g., weighting coefficients) of one or more ofthe alpha mask pixels at locations in the alpha mask 402 that correspondto non-zero pixels (e.g., with adjustment pixel values 608) of theadjustment mask 606.

In implementations in which, for example, a dilated occlusion mask suchas dilated occlusion mask 604 is used in the generation of theadjustment mask 606, the adjustment mask 606 may flag pixels forcorrection or adjustment that span the boundaries between virtual andphysical objects. For example, the adjustment pixel values 608 of theadjustment mask 606 may correspond to pixels that are interior to thepixels corresponding to occlusion mask pixel values 404 of the occlusionmask 400 (e.g., corresponding to pixels in which a physical object fromthe physical environment image is in the foreground), and pixels thatare exterior to the pixels corresponding to occlusion mask pixel values404 of the occlusion mask 400 (e.g., corresponding to pixels in which avirtual object from the virtual image is in the foreground).

In one or more implementations, a system process or an application forgenerating XR environments may be primarily concerned with correctingportions of the image of the physical environment, primarily concernedwith correcting portions of virtual objects and/or the virtual image,and/or correcting the portions of the physical environment image andvirtual image in separate (e.g., parallel) processes. Correcting theimages in these ways may save power and/or processing resources, in oneor more implementations. In order to facilitate correcting only portionsof the physical environment image, correcting only portions of thevirtual image, and/or correcting the portions of the physicalenvironment image and virtual image in separate (e.g., parallel)processes, an electronic device such as electronic device 105 may splitthe adjustment mask to form an interior adjustment mask and an exterioradjustment mask.

FIG. 7 illustrates a process for splitting the adjustment mask to forman interior adjustment mask and an exterior adjustment mask, inaccordance with one or more implementations. As shown in FIG. 7, theadjustment mask 606 can be split to form an interior adjustment mask 700and an exterior adjustment mask 702 by (i) combining (e.g., using alogical AND) the adjustment mask 606 and the occlusion mask 400 to formthe interior adjustment mask 700, and (ii) combining (e.g., using alogical AND) the adjustment mask 606 and an inverse 704 (e.g., a logicalnegation) of the occlusion mask 400 to form the exterior adjustment mask702.

An electronic device may correct only portions of the physicalenvironment image by applying a correction (e.g., to the alpha mask) forpixels flagged in the interior adjustment mask 700. An electronic devicemay correct only portions of the virtual image by applying a correction(e.g., to the alpha mask) for pixels flagged in the exterior adjustmentmask 702. An electronic device may correct the portions of the physicalenvironment image and the virtual content or image in separate (e.g.,parallel) processes by, for example, providing the interior adjustmentmask 700 to a process for correcting the physical environment image andproviding the exterior adjustment mask 702 to a separate process forcorrecting the virtual content or image.

FIG. 8 illustrates a flow diagram of an example process 800 for imagecomposition for extended reality systems, in accordance withimplementations of the subject technology. For explanatory purposes, theprocess 800 is primarily described herein with reference to theelectronic device 105 of FIGS. 1 and 2. However, the process 800 is notlimited to the electronic device 105 of FIGS. 1 and 2, and one or moreblocks (or operations) of the process 800 may be performed by one ormore other components of other suitable devices, including theelectronic device 110, the electronic device 115, and/or the servers120. Further for explanatory purposes, some of the blocks of the process800 are described herein as occurring in serial, or linearly. However,multiple blocks of the process 800 may occur in parallel. In addition,the blocks of the process 800 need not be performed in the order shownand/or one or more blocks of the process 800 need not be performedand/or can be replaced by other operations.

As illustrated in FIG. 8, at block 802, an electronic device such aselectronic device 105 may obtain a virtual image, such as virtual image300, containing at least one virtual object, such as virtual object 308or virtual object 310.

At block 804, the electronic device may obtain a virtual depth image,such as virtual depth image 302, corresponding to the virtual image. Inone or more implementations, the virtual image and/or the virtual depthimage may be generated by an application such as an XR application atthe electronic device.

At block 806, the electronic device may obtain an image, such as image304, containing an image of at least one physical object, such asphysical object 316 or physical object 318. Obtaining the image mayinclude capturing the image using a camera of the electronic device.

At block 808, the electronic device may obtain a physical depth image,such as physical depth image 306, corresponding to the image. Obtainingthe physical depth image may include generating the physical depth imageusing a depth sensor and/or one or more cameras of the electronic device(e.g., by obtaining the physical depth information as an output from aneural network that receives, as input, one or more camera images andposition and/or motion information such as IMU information).

At block 810, the electronic device may generate, based on a comparisonof the virtual depth image and the physical depth image, an occlusionmask, such as occlusion mask 400. In one or more implementations, theocclusion mask indicates pixel locations (e.g., pixels corresponding toocclusion mask pixel values 404) at which the physical object isforeground to the virtual object, or vice versa.

At block 812, the electronic device may generate an edge mask, such asedge mask 600, based on the virtual image and/or the virtual depth image(e.g., as described above in connection with FIG. 6). In one or moreimplementations, the edge mask indicates pixel locations at one or moreedges of the virtual object in the virtual image.

At block 814, the electronic device may generate, based on the occlusionmask and the edge mask, an adjustment mask, such as adjustment mask 606.In one or more implementations, the electronic device may dilate theedge mask prior to generating the adjustment mask, and generate theadjustment mask based on the occlusion mask and the dilated edge mask(e.g., dilated edge mask 602). In one or more implementations, theelectronic device may dilate the occlusion mask prior to generating theadjustment mask, and generate the adjustment mask based on the dilatedocclusion mask (e.g., dilated occlusion mask 604) and the dilated edgemask.

At block 816, the electronic device may generate a composite imageincluding portions of the virtual image and portions of the image usingthe occlusion mask and the adjustment mask. In one or moreimplementations, generating the composite image including portions ofthe virtual image and portions of the image using the occlusion mask andthe adjustment mask may include generating an alpha mask, such as alphamask 402, based on the occlusion mask, and modifying one or moreparameters (e.g., coefficients) of the alpha mask based on theadjustment mask. Generating the composite image may also include formingpixel values of the composite image from one or more of correspondingpixel values of the virtual image and corresponding pixel values of theimage, as determined based on corresponding parameters for correspondingpixels of the alpha mask.

In one or more implementations, the electronic device may also split theadjustment mask to form an interior adjustment mask, such as interioradjustment mask 700, and an exterior adjustment mask, such as exterioradjustment mask 702.

In one or more implementations, generating the composite image using theocclusion mask and the adjustment mask may include generating thecomposite image using the occlusion mask and either the interioradjustment mask or the exterior adjustment mask. In one or moreimplementations, generating the composite image using the occlusion maskand the adjustment mask may include generating the composite image usingthe occlusion mask and both the interior adjustment mask and theexterior adjustment mask. Generating the composite image using theocclusion mask and both the interior adjustment mask and the exterioradjustment mask may include performing a correction associated with theimage using the interior adjustment mask, and performing a correctionassociated with the virtual image using the exterior adjustment mask.

In one or more implementations, splitting the adjustment mask mayinclude generating the interior adjustment mask based on the occlusionmask and the adjustment mask, generating an inverse (e.g., a logicalnegation) of the occlusion mask, and generating the exterior adjustmentmask based on the inverse of the occlusion mask and the adjustment mask(e.g., as described herein in connection with FIG. 7).

FIG. 9 illustrates a flow diagram of another example process 900 forimage composition for extended reality systems, in accordance withimplementations of the subject technology. For explanatory purposes, theprocess 900 is primarily described herein with reference to theelectronic device 105 of FIGS. 1 and 2. However, the process 900 is notlimited to the electronic device 105 of FIGS. 1 and 2, and one or moreblocks (or operations) of the process 900 may be performed by one ormore other components of other suitable devices, including theelectronic device 110, the electronic device 115, and/or the servers120. Further for explanatory purposes, some of the blocks of the process900 are described herein as occurring in serial, or linearly. However,multiple blocks of the process 900 may occur in parallel. In addition,the blocks of the process 900 need not be performed in the order shownand/or one or more blocks of the process 900 need not be performedand/or can be replaced by other operations.

As illustrated in FIG. 9, at block 902, a virtual object andcorresponding virtual depth information may be obtained (e.g., by anelectronic device such as electronic device 105). Obtaining the virtualobject may include generating the virtual object and the correspondingvirtual depth information (e.g., by an application running on theelectronic device).

At block 904, an image of at least one physical object (e.g., physicalobject 316 and/or physical object 318) and corresponding physical depthinformation (e.g., physical depth information for the physical object316 and/or the physical object 318, such as the physical depthinformation indicated by depth pixels 320 and 322) may be captured(e.g., by the electronic device). The image of the physical object andthe corresponding physical depth information can be captured using oneor more cameras such as cameras 150 and/or one or more sensors such assensors 152.

At block 906, an occlusion mask (e.g., occlusion mask 400) may begenerated (e.g., by the electronic device) based at least in part on thevirtual depth information and the physical depth information. In one ormore implementations, the occlusion mask indicates pixel locations atwhich the physical object is foreground to the virtual object.

At block 908, an adjustment mask (e.g., adjustment mask 606) may begenerated (e.g., by the electronic device) based at least in part on theocclusion mask and the virtual depth information.

At block 910, a composite image may be generated including at least aportion of the virtual object and at least a portion of the image usingthe occlusion mask and the adjustment mask.

In one or more implementations, the electronic device may also generatean edge mask (e.g., edge mask 600) based on the virtual depthinformation. The edge mask may indicate, for example, locations at oneor more edges of the virtual object. In one or more implementations, theelectronic device may also dilate the edge mask prior to generating theadjustment mask, and generate the adjustment mask based on the occlusionmask and the dilated edge mask. Generating the adjustment mask based onthe occlusion mask and the dilated edge mask may include dilating theocclusion mask prior to generating the adjustment mask, and generatingthe adjustment mask based on the dilated occlusion mask and the dilatededge mask.

In one or more implementations, generating the composite image includingthe at least the portion of the virtual object and the at least theportion of the image using the occlusion mask and the adjustment mask atblock 910 may include generating an alpha mask (e.g., alpha mask 402)based on the occlusion mask, and modifying one or more parameters of thealpha mask based on the adjustment mask.

In one or more implementations, generating the composite image at block910 may include forming pixel values of the composite image from one ormore of corresponding pixel values of a virtual image (e.g., virtualimage 300) and corresponding pixel values of the image, as determinedbased on corresponding parameters for corresponding pixels of the alphamask.

In one or more implementations, the electronic device may also split theadjustment mask to form an interior adjustment mask (e.g., interioradjustment mask 700) and an exterior adjustment mask (e.g., exterioradjustment mask 702). Generating the composite image at block 910 usingthe occlusion mask and the adjustment mask may include generating thecomposite image using the occlusion mask and either the interioradjustment mask or the exterior adjustment mask, or generating thecomposite image using the occlusion mask and both the interioradjustment mask and the exterior adjustment mask. Generating thecomposite image using the occlusion mask and both the interioradjustment mask and the exterior adjustment mask may include performinga correction associated with the image using the interior adjustmentmask, and performing a correction associated with the virtual objectusing the exterior adjustment mask.

In one or more implementations, splitting the adjustment mask mayinclude generating the interior adjustment mask based on the occlusionmask and the adjustment mask, generating an inverse of the occlusionmask, and generating the exterior adjustment mask based on the inverseof the occlusion mask and the adjustment mask.

The present disclosure recognizes that the use of such personalinformation data, in the present technology, can be used to the benefitof users. For example, the personal information data can be used forimage composition for extended reality systems.

The present disclosure contemplates that those entities responsible forthe collection, analysis, disclosure, transfer, storage, or other use ofsuch personal information data will comply with well-established privacypolicies and/or privacy practices. In particular, such entities would beexpected to implement and consistently apply privacy practices that aregenerally recognized as meeting or exceeding industry or governmentalrequirements for maintaining the privacy of users. Such informationregarding the use of personal data should be prominently and easilyaccessible by users, and should be updated as the collection and/or useof data changes. Personal information from users should be collected forlegitimate uses only. Further, such collection/sharing should occur onlyafter receiving the consent of the users or other legitimate basisspecified in applicable law. Additionally, such entities should considertaking any needed steps for safeguarding and securing access to suchpersonal information data and ensuring that others with access to thepersonal information data adhere to their privacy policies andprocedures. Further, such entities can subject themselves to evaluationby third parties to certify their adherence to widely accepted privacypolicies and practices. In addition, policies and practices should beadapted for the particular types of personal information data beingcollected and/or accessed and adapted to applicable laws and standards,including jurisdiction-specific considerations which may serve to imposea higher standard. For instance, in the US, collection of or access tocertain health data may be governed by federal and/or state laws, suchas the Health Insurance Portability and Accountability Act (HIPAA);whereas health data in other countries may be subject to otherregulations and policies and should be handled accordingly.

Despite the foregoing, the present disclosure also contemplatesembodiments in which users selectively block the use of, or access to,personal information data. That is, the present disclosure contemplatesthat hardware and/or software elements can be provided to prevent orblock access to such personal information data. For example, in the caseof image composition for extended reality systems, the presenttechnology can be configured to allow users to select to “opt in” or“opt out” of participation in the collection and/or sharing of personalinformation data during registration for services or anytime thereafter.In addition to providing “opt in” and “opt out” options, the presentdisclosure contemplates providing notifications relating to the accessor use of personal information. For instance, a user may be notifiedupon downloading an app that their personal information data will beaccessed and then reminded again just before personal information datais accessed by the app.

Moreover, it is the intent of the present disclosure that personalinformation data should be managed and handled in a way to minimizerisks of unintentional or unauthorized access or use. Risk can beminimized by limiting the collection of data and deleting data once itis no longer needed. In addition, and when applicable, including incertain health related applications, data de-identification can be usedto protect a user's privacy. De-identification may be facilitated, whenappropriate, by removing identifiers, controlling the amount orspecificity of data stored (e.g., collecting location data at city levelrather than at an address level or at a scale that is insufficient forfacial recognition), controlling how data is stored (e.g., aggregatingdata across users), and/or other methods such as differential privacy.

Therefore, although the present disclosure broadly covers use ofpersonal information data to implement one or more various disclosedembodiments, the present disclosure also contemplates that the variousembodiments can also be implemented without the need for accessing suchpersonal information data. That is, the various embodiments of thepresent technology are not rendered inoperable due to the lack of all ora portion of such personal information data.

FIG. 10 illustrates an electronic system 1000 with which one or moreimplementations of the subject technology may be implemented. Theelectronic system 1000 can be, and/or can be a part of, the electronicdevice 105, the handheld electronic device 104, the electronic device110, the electronic device 115, and/or the server 120 as shown inFIG. 1. The electronic system 1000 may include various types of computerreadable media and interfaces for various other types of computerreadable media. The electronic system 1000 includes a bus 1008, one ormore processing unit(s) 1012, a system memory 1004 (and/or buffer), aROM 1010, a permanent storage device 1002, an input device interface1014, an output device interface 1006, and one or more networkinterfaces 1016, or subsets and variations thereof.

The bus 1008 collectively represents all system, peripheral, and chipsetbuses that communicatively connect the numerous internal devices of theelectronic system 1000. In one or more implementations, the bus 1008communicatively connects the one or more processing unit(s) 1012 withthe ROM 1010, the system memory 1004, and the permanent storage device1002. From these various memory units, the one or more processingunit(s) 1012 retrieves instructions to execute and data to process inorder to execute the processes of the subject disclosure. The one ormore processing unit(s) 1012 can be a single processor or a multi-coreprocessor in different implementations.

The ROM 1010 stores static data and instructions that are needed by theone or more processing unit(s) 1012 and other modules of the electronicsystem 1000. The permanent storage device 1002, on the other hand, maybe a read-and-write memory device. The permanent storage device 1002 maybe a non-volatile memory unit that stores instructions and data evenwhen the electronic system 1000 is off. In one or more implementations,a mass-storage device (such as a magnetic or optical disk and itscorresponding disk drive) may be used as the permanent storage device1002.

In one or more implementations, a removable storage device (such as afloppy disk, flash drive, and its corresponding disk drive) may be usedas the permanent storage device 1002. Like the permanent storage device1002, the system memory 1004 may be a read-and-write memory device.However, unlike the permanent storage device 1002, the system memory1004 may be a volatile read-and-write memory, such as random accessmemory. The system memory 1004 may store any of the instructions anddata that one or more processing unit(s) 1012 may need at runtime. Inone or more implementations, the processes of the subject disclosure arestored in the system memory 1004, the permanent storage device 1002,and/or the ROM 1010 (which are each implemented as a non-transitorycomputer-readable medium). From these various memory units, the one ormore processing unit(s) 1012 retrieves instructions to execute and datato process in order to execute the processes of one or moreimplementations.

The bus 1008 also connects to the input and output device interfaces1014 and 1006. The input device interface 1014 enables a user tocommunicate information and select commands to the electronic system1000. Input devices that may be used with the input device interface1014 may include, for example, alphanumeric keyboards and pointingdevices (also called “cursor control devices”). The output deviceinterface 1006 may enable, for example, the display of images generatedby electronic system 1000. Output devices that may be used with theoutput device interface 1006 may include, for example, printers anddisplay devices, such as a liquid crystal display (LCD), a lightemitting diode (LED) display, an organic light emitting diode (OLED)display, a flexible display, a flat panel display, a solid statedisplay, a projector, or any other device for outputting information.One or more implementations may include devices that function as bothinput and output devices, such as a touchscreen. In theseimplementations, feedback provided to the user can be any form ofsensory feedback, such as visual feedback, auditory feedback, or tactilefeedback; and input from the user can be received in any form, includingacoustic, speech, or tactile input.

Finally, as shown in FIG. 10, the bus 1008 also couples the electronicsystem 1000 to one or more networks and/or to one or more network nodes,such as the electronic device 110 shown in FIG. 1, through the one ormore network interface(s) 1016. In this manner, the electronic system1000 can be a part of a network of computers (such as a LAN, a wide areanetwork (“WAN”), or an Intranet, or a network of networks, such as theInternet. Any or all components of the electronic system 1000 can beused in conjunction with the subject disclosure.

These functions described above can be implemented in computer software,firmware or hardware. The techniques can be implemented using one ormore computer program products. Programmable processors and computerscan be included in or packaged as mobile devices. The processes andlogic flows can be performed by one or more programmable processors andby one or more programmable logic circuitry. General and special purposecomputing devices and storage devices can be interconnected throughcommunication networks.

Some implementations include electronic components, such asmicroprocessors, storage and memory that store computer programinstructions in a machine-readable or computer-readable medium (alsoreferred to as computer-readable storage media, machine-readable media,or machine-readable storage media). Some examples of suchcomputer-readable media include RAM, ROM, read-only compact discs(CD-ROM), recordable compact discs (CD-R), rewritable compact discs(CD-RW), read-only digital versatile discs (e.g., DVD-ROM, dual-layerDVD-ROM), a variety of recordable/rewritable DVDs (e.g., DVD-RAM,DVD−RW, DVD+RW, etc.), flash memory (e.g., SD cards, mini-SD cards,micro-SD cards, etc.), magnetic and/or solid state hard drives,read-only and recordable Blu-Ray® discs, ultra density optical discs,any other optical or magnetic media, and floppy disks. Thecomputer-readable media can store a computer program that is executableby at least one processing unit and includes sets of instructions forperforming various operations. Examples of computer programs or computercode include machine code, such as is produced by a compiler, and filesincluding higher-level code that are executed by a computer, anelectronic component, or a microprocessor using an interpreter.

While the above discussion primarily refers to microprocessor ormulti-core processors that execute software, some implementations areperformed by one or more integrated circuits, such as applicationspecific integrated circuits (ASICs) or field programmable gate arrays(FPGAs). In some implementations, such integrated circuits executeinstructions that are stored on the circuit itself.

As used in this specification and any claims of this application, theterms “computer”, “server”, “processor”, and “memory” all refer toelectronic or other technological devices. These terms exclude people orgroups of people. For the purposes of the specification, the termsdisplay or displaying means displaying on an electronic device. As usedin this specification and any claims of this application, the terms“computer readable medium” and “computer readable media” are entirelyrestricted to tangible, physical objects that store information in aform that is readable by a computer. These terms exclude any wirelesssignals, wired download signals, and any other ephemeral signals.

To provide for interaction with a user, implementations of the subjectmatter described in this specification can be implemented on a computerhaving a display device, e.g., a CRT (cathode ray tube) or LCD (liquidcrystal display) monitor, for displaying information to the user and akeyboard and a pointing device, e.g., a mouse or a trackball, by whichthe user can provide input to the computer. Other kinds of devices canbe used to provide for interaction with a user as well; e.g., feedbackprovided to the user can be any form of sensory feedback, e.g., visualfeedback, auditory feedback, or tactile feedback; and input from theuser can be received in any form, including acoustic, speech, or tactileinput. In addition, a computer can interact with a user by sendingdocuments to and receiving documents from a device that is used by theuser; e.g., by sending web pages to a web browser on a user's clientdevice in response to requests received from the web browser.

Embodiments of the subject matter described in this specification can beimplemented in a computing system that includes a back end component,e.g., as a data server, or that includes a middleware component, e.g.,an application server, or that includes a front end component, e.g., aclient computer having a graphical user interface or a Web browserthrough which a user can interact with an implementation of the subjectmatter described in this specification, or any combination of one ormore such back end, middleware, or front end components. The componentsof the system can be interconnected by any form or medium of digitaldata communication, e.g., a communication network. Examples ofcommunication networks include a local area network (“LAN”) and a widearea network (“WAN”), an inter-network (e.g., the Internet), andpeer-to-peer networks (e.g., ad hoc peer-to-peer networks).

The computing system can include clients and servers. A client andserver are generally remote from each other and may interact through acommunication network. The relationship of client and server arises byvirtue of computer programs running on the respective computers andhaving a client-server relationship to each other. In some embodiments,a server transmits data (e.g., an HTML, page) to a client device (e.g.,for purposes of displaying data to and receiving user input from a userinteracting with the client device). Data generated at the client device(e.g., a result of the user interaction) can be received from the clientdevice at the server.

In accordance with aspects of the disclosure, a method is provided thatincludes obtaining a virtual object and corresponding virtual depthinformation; capturing an image of at least one physical object andcorresponding physical depth information; generating an occlusion maskbased at least in part on the virtual depth information and the physicaldepth information; generating an adjustment mask based at least in parton the occlusion mask and the virtual depth information; and generatinga composite image including at least a portion of the virtual object andat least a portion of the image using the occlusion mask and theadjustment mask.

In accordance with aspects of the disclosure, a device is provided thatincludes a camera; memory; and one or more processors configured to:obtain a virtual object and corresponding virtual depth information;capture, using at least the camera, an image of at least one physicalobject and corresponding physical depth information; generate anocclusion mask based at least in part on the virtual depth informationand the physical depth information; generate an adjustment mask based atleast in part on the occlusion mask and the virtual depth information;and generate a composite image including at least a portion of thevirtual object and at least a portion of the image using the occlusionmask and the adjustment mask.

In accordance with aspects of the disclosure, a non-transitorycomputer-readable medium is provided storing instructions which, whenexecuted by one or more processors, cause the one or more processors toperform operations that include: obtaining a virtual object andcorresponding virtual depth information; capturing an image of at leastone physical object and corresponding physical depth information;generating an occlusion mask based at least in part on the virtual depthinformation and the physical depth information; generating an adjustmentmask based at least in part on the occlusion mask and the virtual depthinformation; and generating a composite image including at least aportion of the virtual object and at least a portion of the image usingthe occlusion mask and the adjustment mask.

Implementations within the scope of the present disclosure can bepartially or entirely realized using a tangible computer-readablestorage medium (or multiple tangible computer-readable storage media ofone or more types) encoding one or more instructions. The tangiblecomputer-readable storage medium also can be non-transitory in nature.

The computer-readable storage medium can be any storage medium that canbe read, written, or otherwise accessed by a general purpose or specialpurpose computing device, including any processing electronics and/orprocessing circuitry capable of executing instructions. For example,without limitation, the computer-readable medium can include anyvolatile semiconductor memory, such as RAM, DRAM, SRAM, T-RAM, Z-RAM,and TTRAM. The computer-readable medium also can include anynon-volatile semiconductor memory, such as ROM, PROM, EPROM, EEPROM,NVRAM, flash, nvSRAM, FeRAM, FeTRAM, MRAM, PRAM, CBRAM, SONOS, RRAM,NRAM, racetrack memory, FJG, and Millipede memory.

Further, the computer-readable storage medium can include anynon-semiconductor memory, such as optical disk storage, magnetic diskstorage, magnetic tape, other magnetic storage devices, or any othermedium capable of storing one or more instructions. In one or moreimplementations, the tangible computer-readable storage medium can bedirectly coupled to a computing device, while in other implementations,the tangible computer-readable storage medium can be indirectly coupledto a computing device, e.g., via one or more wired connections, one ormore wireless connections, or any combination thereof.

Instructions can be directly executable or can be used to developexecutable instructions. For example, instructions can be realized asexecutable or non-executable machine code or as instructions in ahigh-level language that can be compiled to produce executable ornon-executable machine code. Further, instructions also can be realizedas or can include data. Computer-executable instructions also can beorganized in any format, including routines, subroutines, programs, datastructures, objects, modules, applications, applets, functions, etc. Asrecognized by those of skill in the art, details including, but notlimited to, the number, structure, sequence, and organization ofinstructions can vary significantly without varying the underlyinglogic, function, processing, and output.

While the above discussion primarily refers to microprocessor ormulti-core processors that execute software, one or more implementationsare performed by one or more integrated circuits, such as ASICs orFPGAs. In one or more implementations, such integrated circuits executeinstructions that are stored on the circuit itself.

Those of skill in the art would appreciate that the various illustrativeblocks, modules, elements, components, methods, and algorithms describedherein may be implemented as electronic hardware, computer software, orcombinations of both. To illustrate this interchangeability of hardwareand software, various illustrative blocks, modules, elements,components, methods, and algorithms have been described above generallyin terms of their functionality. Whether such functionality isimplemented as hardware or software depends upon the particularapplication and design constraints imposed on the overall system.Skilled artisans may implement the described functionality in varyingways for each particular application. Various components and blocks maybe arranged differently (e.g., arranged in a different order, orpartitioned in a different way) all without departing from the scope ofthe subject technology.

It is understood that any specific order or hierarchy of blocks in theprocesses disclosed is an illustration of example approaches. Based upondesign preferences, it is understood that the specific order orhierarchy of blocks in the processes may be rearranged, or that allillustrated blocks be performed. Any of the blocks may be performedsimultaneously. In one or more implementations, multitasking andparallel processing may be advantageous. Moreover, the separation ofvarious system components in the implementations described above shouldnot be understood as requiring such separation in all implementations,and it should be understood that the described program components andsystems can generally be integrated together in a single softwareproduct or packaged into multiple software products.

As used in this specification and any claims of this application, theterms “base station”, “receiver”, “computer”, “server”, “processor”, and“memory” all refer to electronic or other technological devices. Theseterms exclude people or groups of people. For the purposes of thespecification, the terms “display” or “displaying” means displaying onan electronic device.

As used herein, the phrase “at least one of” preceding a series ofitems, with the term “and” or “or” to separate any of the items,modifies the list as a whole, rather than each member of the list (i.e.,each item). The phrase “at least one of” does not require selection ofat least one of each item listed; rather, the phrase allows a meaningthat includes at least one of any one of the items, and/or at least oneof any combination of the items, and/or at least one of each of theitems. By way of example, the phrases “at least one of A, B, and C” or“at least one of A, B, or C” each refer to only A, only B, or only C;any combination of A, B, and C; and/or at least one of each of A, B, andC.

The predicate words “configured to”, “operable to”, and “programmed to”do not imply any particular tangible or intangible modification of asubject, but, rather, are intended to be used interchangeably. In one ormore implementations, a processor configured to monitor and control anoperation or a component may also mean the processor being programmed tomonitor and control the operation or the processor being operable tomonitor and control the operation. Likewise, a processor configured toexecute code can be construed as a processor programmed to execute codeor operable to execute code.

Phrases such as an aspect, the aspect, another aspect, some aspects, oneor more aspects, an implementation, the implementation, anotherimplementation, some implementations, one or more implementations, anembodiment, the embodiment, another embodiment, some implementations,one or more implementations, a configuration, the configuration, anotherconfiguration, some configurations, one or more configurations, thesubject technology, the disclosure, the present disclosure, othervariations thereof and alike are for convenience and do not imply that adisclosure relating to such phrase(s) is essential to the subjecttechnology or that such disclosure applies to all configurations of thesubject technology. A disclosure relating to such phrase(s) may apply toall configurations, or one or more configurations. A disclosure relatingto such phrase(s) may provide one or more examples. A phrase such as anaspect or some aspects may refer to one or more aspects and vice versa,and this applies similarly to other foregoing phrases.

The word “exemplary” is used herein to mean “serving as an example,instance, or illustration”. Any embodiment described herein as“exemplary” or as an “example” is not necessarily to be construed aspreferred or advantageous over other implementations. Furthermore, tothe extent that the term “include”, “have”, or the like is used in thedescription or the claims, such term is intended to be inclusive in amanner similar to the term “comprise” as “comprise” is interpreted whenemployed as a transitional word in a claim.

All structural and functional equivalents to the elements of the variousaspects described throughout this disclosure that are known or latercome to be known to those of ordinary skill in the art are expresslyincorporated herein by reference and are intended to be encompassed bythe claims. Moreover, nothing disclosed herein is intended to bededicated to the public regardless of whether such disclosure isexplicitly recited in the claims. No claim element is to be construedunder the provisions of 35 U.S.C. § 112(f) unless the element isexpressly recited using the phrase “means for” or, in the case of amethod claim, the element is recited using the phrase “step for”.

The previous description is provided to enable any person skilled in theart to practice the various aspects described herein. Variousmodifications to these aspects will be readily apparent to those skilledin the art, and the generic principles defined herein may be applied toother aspects. Thus, the claims are not intended to be limited to theaspects shown herein, but are to be accorded the full scope consistentwith the language claims, wherein reference to an element in thesingular is not intended to mean “one and only one” unless specificallyso stated, but rather “one or more”. Unless specifically statedotherwise, the term “some” refers to one or more. Pronouns in themasculine (e.g., his) include the feminine and neuter gender (e.g., herand its) and vice versa. Headings and subheadings, if any, are used forconvenience only and do not limit the subject disclosure.

What is claimed is:
 1. A method, comprising: obtaining a virtual objectand corresponding virtual depth information; capturing an image of atleast one physical object and corresponding physical depth information;generating an occlusion mask based at least in part on the virtual depthinformation and the physical depth information; generating an adjustmentmask based at least in part on the occlusion mask and the virtual depthinformation; and generating a composite image including at least aportion of the virtual object and at least a portion of the image usingthe occlusion mask and the adjustment mask.
 2. The method of claim 1,wherein the occlusion mask indicates pixel locations at which thephysical object is foreground to the virtual object.
 3. The method ofclaim 2, further comprising generating an edge mask based on the virtualdepth information, wherein the edge mask indicates locations at one ormore edges of the virtual object.
 4. The method of claim 3, furthercomprising: dilating the edge mask prior to generating the adjustmentmask; and generating the adjustment mask based on the occlusion mask andthe dilated edge mask.
 5. The method of claim 4, wherein generating theadjustment mask based on the occlusion mask and the dilated edge maskcomprises: dilating the occlusion mask prior to generating theadjustment mask; and generating the adjustment mask based on the dilatedocclusion mask and the dilated edge mask.
 6. The method of claim 1,wherein generating the composite image including the at least theportion of the virtual object and the at least the portion of the imageusing the occlusion mask and the adjustment mask comprises: generatingan alpha mask based on the occlusion mask; and modifying one or moreparameters of the alpha mask based on the adjustment mask.
 7. The methodof claim 6, wherein generating the composite image further comprises:forming pixel values of the composite image from one or more ofcorresponding pixel values of a virtual image and corresponding pixelvalues of the image, as determined based on corresponding parameters forcorresponding pixels of the alpha mask.
 8. The method of claim 1,further comprising: splitting the adjustment mask to form an interioradjustment mask and an exterior adjustment mask, wherein generating thecomposite image using the occlusion mask and the adjustment maskcomprises generating the composite image using the occlusion mask andeither the interior adjustment mask or the exterior adjustment mask. 9.The method of claim 8, wherein splitting the adjustment mask comprises:generating the interior adjustment mask based on the occlusion mask andthe adjustment mask; generating an inverse of the occlusion mask; andgenerating the exterior adjustment mask based on the inverse of theocclusion mask and the adjustment mask.
 10. The method of claim 1,further comprising: splitting the adjustment mask to form an interioradjustment mask and an exterior adjustment mask, wherein generating thecomposite image using the occlusion mask and the adjustment maskcomprises generating the composite image using the occlusion mask andboth the interior adjustment mask and the exterior adjustment mask. 11.The method of claim 10, wherein generating the composite image using theocclusion mask and both the interior adjustment mask and the exterioradjustment mask comprises: performing a correction associated with theimage using the interior adjustment mask; and performing a correctionassociated with the virtual object using the exterior adjustment mask.12. A device, comprising: a camera; memory; and one or more processorsconfigured to: obtain a virtual object and corresponding virtual depthinformation; capture, using at least the camera, an image of at leastone physical object and corresponding physical depth information;generate an occlusion mask based at least in part on the virtual depthinformation and the physical depth information; generate an adjustmentmask based at least in part on the occlusion mask and the virtual depthinformation; and generate a composite image including at least a portionof the virtual object and at least a portion of the image using theocclusion mask and the adjustment mask.
 13. The device of claim 12,further comprising a depth sensor configured to obtain the physicaldepth information, and a display configured to display the compositeimage.
 14. The device of claim 12, wherein the one or more processorsare configured to generate the composite image including the at leastthe portion of the virtual object and the at least the portion of theimage using the occlusion mask and the adjustment mask by: generating analpha mask based on the occlusion mask; and modifying one or moreparameters of the alpha mask based on the adjustment mask.
 15. Thedevice of claim 14, wherein the one or more processors are furtherconfigured to generate the composite image by forming pixel values ofthe composite image from one or more of corresponding pixel values of avirtual image and corresponding pixel values of the image, as determinedbased on corresponding parameters for corresponding pixels of the alphamask.
 16. The device of claim 12, wherein the one or more processors arefurther configured to: generate an edge mask based on the virtual depthinformation; dilate the edge mask prior to generating the adjustmentmask; and generate the adjustment mask based on the occlusion mask andthe dilated edge mask.
 17. The device of claim 16, wherein the one ormore processors are configured to generate the adjustment mask based onthe occlusion mask and the dilated edge mask by: dilating the occlusionmask prior to generating the adjustment mask; and generating theadjustment mask based on the dilated occlusion mask and the dilated edgemask.
 18. A non-transitory computer-readable medium storing instructionswhich, when executed by one or more processors, cause the one or moreprocessors to perform operations comprising: obtaining a virtual objectand corresponding virtual depth information; capturing an image of atleast one physical object and corresponding physical depth information;generating an occlusion mask based at least in part on the virtual depthinformation and the physical depth information; generating an adjustmentmask based at least in part on the occlusion mask and the virtual depthinformation; and generating a composite image including at least aportion of the virtual object and at least a portion of the image usingthe occlusion mask and the adjustment mask.
 19. The non-transitorycomputer-readable medium of claim 18, wherein the operations furthercomprise: generating an edge mask based on the virtual depthinformation; dilating the edge mask prior to generating the adjustmentmask; and generating the adjustment mask based on the occlusion mask andthe dilated edge mask.
 20. The non-transitory computer-readable mediumof claim 19, wherein generating the adjustment mask based on theocclusion mask and the dilated edge mask includes: dilating theocclusion mask prior to generating the adjustment mask; and generatingthe adjustment mask based on the dilated occlusion mask and the dilatededge mask.